#!/usr/bin/env bats

@test "static no-case: static (when dynamic is the same as static, nothing happens)" {
  cd $BATS_TEST_DIRNAME
  expected="file1:23:to his commits. This ID allows Gerrit to link together different versions of
file1:57:The output of this command also contains a link to a web page Max can use to
file1:58:review this commit. Clicking on that link takes him to a screen similar to the"
  result="$(fish -c 'tbgs link')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs link no-case')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs no-case link')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs liNK')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs liNK no-case')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs no-case liNK')"; [ "$result" = "$expected" ]
}

@test "static no-case: dynamic overwrites static" {
  cd $BATS_TEST_DIRNAME
  expected=""
  result="$(fish -c 'tbgs case liNK')"; [ "$result" = "$expected" ]
  result="$(fish -c 'tbgs liNK case')"; [ "$result" = "$expected" ]
}
